<template>
  <div class="err-container">
    <img class="pic-image" src="@/assets/error_images/oops.png">
    <div class="tip">抱歉，您没有访问该页面的权限</div>
    <div v-if="permission" class="desc">
      访问页面：{{ menuName }}<br>
      权限编码：{{ permission }}
    </div>
    <div class="option">
      <el-button type="primary" round @click="goHome">返回首页</el-button>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      permission: null,
      menuName: null
    }
  },
  watch: {
    '$route': function() {
      var { permission, menuName } = this.$route.query
      this.permission = permission
      this.menuName = menuName
    }
  },
  created() {
    var { permission, menuName } = this.$route.query
    this.permission = permission
    this.menuName = menuName
  },
  methods: {
    goHome() {
      this.$router.push('/')
    },
    goBack() {
      this.$router.go(-1)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
